package io.renren.modules.reception.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.reception.dao.TStoreChangeWorkRecordDao;
import io.renren.modules.reception.entity.TStoreChangeWorkRecordEntity;
import io.renren.modules.reception.service.TStoreChangeWorkRecordService;

@Service("tStoreChangeWorkRecordService")
public class TStoreChangeWorkRecordServiceImpl extends ServiceImpl<TStoreChangeWorkRecordDao, TStoreChangeWorkRecordEntity> implements TStoreChangeWorkRecordService {

    @Autowired
    private TStoreChangeWorkRecordDao storeChangeWorkRecordDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TStoreChangeWorkRecordEntity> page = this.page(
                new Query<TStoreChangeWorkRecordEntity>().getPage(params),
                new QueryWrapper<TStoreChangeWorkRecordEntity>()
                .eq("seller_id",params.get("sellerId"))
                .eq(params.get("key") != null,"user_name",params.get("key"))
        );

        return new PageUtils(page);
    }

    @Override
    public Double devolutionCash(Map<String, Object> map) {
        return storeChangeWorkRecordDao.devolutionCash(map);
    }


}